home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  26.3 KB  |  847 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.0
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT CMApplication;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CMAPPLICATION__}
  30. {$SETC __CMAPPLICATION__ := 1}
  31.  
  32. {$I+}
  33. {$SETC CMApplicationIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    QuickdrawText.p                                                }
  47.  
  48. {$IFC UNDEFINED __FILES__}
  49. {$I Files.p}
  50. {$ENDC}
  51. {    OSUtils.p                                                    }
  52. {        Memory.p                                                }
  53.  
  54. {$IFC UNDEFINED __PRINTING__}
  55. {$I Printing.p}
  56. {$ENDC}
  57. {    Errors.p                                                    }
  58. {    Dialogs.p                                                    }
  59. {        Windows.p                                                }
  60. {            Events.p                                            }
  61. {            Controls.p                                            }
  62. {                Menus.p                                            }
  63. {        TextEdit.p                                                }
  64.  
  65. {$IFC UNDEFINED __CMICCPROFILE__}
  66. {$I CMICCProfile.p}
  67. {$ENDC}
  68.  
  69. {$PUSH}
  70. {$ALIGN MAC68K}
  71. {$LibExport+}
  72.  
  73. CONST
  74.     gestaltColorSync20            = $0200;
  75.  
  76.     kDefaultCMMSignature        = 'appl';
  77.  
  78. { Macintosh 68K trap word }
  79.     cmTrap                        = $ABEE;
  80.  
  81. { PicComment IDs }
  82.     cmBeginProfile                = 220;
  83.     cmEndProfile                = 221;
  84.     cmEnableMatching            = 222;
  85.     cmDisableMatching            = 223;
  86.     cmComment                    = 224;
  87.  
  88. { PicComment selectors for cmComment }
  89.     cmBeginProfileSel            = 0;
  90.     cmContinueProfileSel        = 1;
  91.     cmEndProfileSel                = 2;
  92.  
  93. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  94.     cmMatchCMMType                = $00000001;
  95.     cmMatchApplProfileVersion    = $00000002;
  96.     cmMatchDataType                = $00000004;
  97.     cmMatchDeviceType            = $00000008;
  98.     cmMatchDeviceManufacturer    = $00000010;
  99.     cmMatchDeviceModel            = $00000020;
  100.     cmMatchDeviceAttributes        = $00000040;
  101.     cmMatchFlags                = $00000080;
  102.     cmMatchOptions                = $00000100;
  103.     cmMatchWhite                = $00000200;
  104.     cmMatchBlack                = $00000400;
  105.  
  106. { Defines for version 2.0 CMSearchRecord.searchMask }
  107.     cmMatchAnyProfile            = $00000000;
  108.     cmMatchProfileCMMType        = $00000001;
  109.     cmMatchProfileClass            = $00000002;
  110.     cmMatchDataColorSpace        = $00000004;
  111.     cmMatchProfileConnectionSpace = $00000008;
  112.     cmMatchManufacturer            = $00000010;
  113.     cmMatchModel                = $00000020;
  114.     cmMatchAttributes            = $00000040;
  115.     cmMatchProfileFlags            = $00000080;
  116.  
  117. { Result codes }
  118. { General Errors }
  119.     cmProfileError                = -170;
  120.     cmMethodError                = -171;
  121.     cmMethodNotFound            = -175;                            { CMM not present }
  122.     cmProfileNotFound            = -176;                            { Responder error }
  123.     cmProfilesIdentical            = -177;                            { Profiles the same }
  124.     cmCantConcatenateError        = -178;                            { Profile can't be concatenated }
  125.     cmCantXYZ                    = -179;                            { CMM cant handle XYZ space }
  126.     cmCantDeleteProfile            = -180;                            { Responder error }
  127.     cmUnsupportedDataType        = -181;                            { Responder error }
  128.     cmNoCurrentProfile            = -182;                            { Responder error }
  129. { Profile Access Errors }
  130.     cmElementTagNotFound        = -4200;
  131.     cmIndexRangeErr                = -4201;                        { Index out of range }
  132.     cmCantDeleteElement            = -4202;
  133.     cmFatalProfileErr            = -4203;
  134.     cmInvalidProfile            = -4204;                        { A Profile must contain a 'cs1 ' tag to be valid }
  135.     cmInvalidProfileLocation    = -4205;                        { Operation not supported for this profile location }
  136. { Profile Search Errors }
  137.     cmInvalidSearch                = -4206;                        { Bad Search Handle }
  138.     cmSearchError                = -4207;
  139.     cmErrIncompatibleProfile    = -4208;
  140. { Other ColorSync Errors }
  141.     cmInvalidColorSpace            = -4209;                        { Profile colorspace does not match bitmap type }
  142.     cmInvalidSrcMap                = -4210;                        { Source pix/bit map was invalid }
  143.     cmInvalidDstMap                = -4211;                        { Destination pix/bit map was invalid }
  144.     cmNoGDevicesError            = -4212;                        { Begin/End Matching -- no gdevices available }
  145.     cmInvalidProfileComment        = -4213;                        { Bad Profile comment during drawpicture }
  146. { Color Conversion Errors }
  147.     cmRangeOverFlow                = -4214;                        { One or more output color value overflows in color conversion 
  148.                                                         all input color values will still be converted, and the overflown 
  149.                                                         will be clipped }
  150. { Other Profile Access Errors }
  151.     cmCantCopyModifiedV1Profile    = -4215;                        { It is illegal to copy version 1 profiles that  
  152.                                                         have been modified }
  153.  
  154. { deviceType values for ColorSync 1.0 Device Profile access }
  155.     cmSystemDevice                = 'sys ';
  156.     cmGDevice                    = 'gdev';
  157.  
  158. { Commands for CMFlattenUPP(…) }
  159.     cmOpenReadSpool                = 1;
  160.     cmOpenWriteSpool            = 2;
  161.     cmReadSpool                    = 3;
  162.     cmWriteSpool                = 4;
  163.     cmCloseSpool                = 5;
  164.  
  165. { Flags for PostScript-related functions }
  166.     cmPS7bit                    = 1;
  167.     cmPS8bit                    = 2;
  168.  
  169.     
  170. TYPE
  171.     CMProfileRef = Ptr;
  172.  
  173. { Abstract data type for Profile search result }
  174.     CMProfileSearchRef = Ptr;
  175.  
  176. { Abstract data type for BeginMatching(…) reference }
  177.     CMMatchRef = Ptr;
  178.  
  179. { Abstract data type for ColorWorld reference }
  180.     CMWorldRef = Ptr;
  181.  
  182. { Caller-supplied progress function for Bitmap & PixMap matching routines }
  183. { Caller-supplied filter function for Profile search }
  184.     CMFlattenProcPtr = ProcPtr;  { FUNCTION CMFlatten(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  185.     CMBitmapCallBackProcPtr = ProcPtr;  { FUNCTION CMBitmapCallBack(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN; }
  186.     CMProfileFilterProcPtr = ProcPtr;  { FUNCTION CMProfileFilter(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN; }
  187.     CMFlattenUPP = UniversalProcPtr;
  188.     CMBitmapCallBackUPP = UniversalProcPtr;
  189.     CMProfileFilterUPP = UniversalProcPtr;
  190.  
  191. CONST
  192.     uppCMFlattenProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  193.     uppCMBitmapCallBackProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
  194.     uppCMProfileFilterProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
  195.  
  196. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  197.     {$IFC NOT GENERATINGCFM }
  198.     INLINE $2E9F;
  199.     {$ENDC}
  200.  
  201. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  202.     {$IFC NOT GENERATINGCFM }
  203.     INLINE $2E9F;
  204.     {$ENDC}
  205.  
  206. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  207.     {$IFC NOT GENERATINGCFM }
  208.     INLINE $2E9F;
  209.     {$ENDC}
  210.  
  211. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  212.     {$IFC NOT GENERATINGCFM}
  213.     INLINE $205F, $4E90;
  214.     {$ENDC}
  215.  
  216. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  217.     {$IFC NOT GENERATINGCFM}
  218.     INLINE $205F, $4E90;
  219.     {$ENDC}
  220.  
  221. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  222.     {$IFC NOT GENERATINGCFM}
  223.     INLINE $205F, $4E90;
  224.     {$ENDC}
  225.     
  226. TYPE
  227.     CMError = LONGINT;
  228.  
  229. { For 1.0 and 2.0 profile header variants }
  230. { CMAppleProfileHeader }
  231.     CMAppleProfileHeader = RECORD
  232.         CASE INTEGER OF
  233.         0: (
  234.             cm1:                        CMHeader;
  235.            );
  236.         1: (
  237.             cm2:                        CM2Header;
  238.            );
  239.     END;
  240.  
  241. { Param for CWConcatColorWorld(…) }
  242.     CMConcatProfileSet = RECORD
  243.         keyIndex:                INTEGER;                                { Zero-based }
  244.         count:                    INTEGER;                                { Min 1 }
  245.         profileSet:                ARRAY [0..0] OF CMProfileRef;            { Variable. Ordered from Source -> Dest }
  246.     END;
  247.  
  248. { ColorSync color data types }
  249.     CMRGBColor = RECORD
  250.         red:                    INTEGER;                                { 0..65535 }
  251.         green:                    INTEGER;
  252.         blue:                    INTEGER;
  253.     END;
  254.  
  255.     CMCMYKColor = RECORD
  256.         cyan:                    INTEGER;                                { 0..65535 }
  257.         magenta:                INTEGER;
  258.         yellow:                    INTEGER;
  259.         black:                    INTEGER;
  260.     END;
  261.  
  262.     CMCMYColor = RECORD
  263.         cyan:                    INTEGER;                                { 0..65535 }
  264.         magenta:                INTEGER;
  265.         yellow:                    INTEGER;
  266.     END;
  267.  
  268.     CMHLSColor = RECORD
  269.         hue:                    INTEGER;                                { 0..65535. Fraction of circle. Red at 0 }
  270.         lightness:                INTEGER;                                { 0..65535 }
  271.         saturation:                INTEGER;                                { 0..65535 }
  272.     END;
  273.  
  274.     CMHSVColor = RECORD
  275.         hue:                    INTEGER;                                { 0..65535. Fraction of circle. Red at 0 }
  276.         saturation:                INTEGER;                                { 0..65535 }
  277.         value:                    INTEGER;                                { 0..65535 }
  278.     END;
  279.  
  280.     CMLabColor = RECORD
  281.         L:                        INTEGER;                                { 0..65535 maps to 0..100 }
  282.         a:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  283.         b:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  284.     END;
  285.  
  286.     CMLuvColor = RECORD
  287.         L:                        INTEGER;                                { 0..65535 maps to 0..100 }
  288.         u:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  289.         v:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  290.     END;
  291.  
  292.     CMYxyColor = RECORD
  293.         capY:                    INTEGER;                                { 0..65535 maps to 0..1 }
  294.         x:                        INTEGER;                                { 0..65535 maps to 0..1 }
  295.         y:                        INTEGER;                                { 0..65535 maps to 0..1 }
  296.     END;
  297.  
  298.     CMGrayColor = RECORD
  299.         gray:                    INTEGER;                                { 0..65535 }
  300.     END;
  301.  
  302.     CMMultichannel5Color = RECORD
  303.         components:                ARRAY [0..4] OF SInt8; (* unsigned char *) { 0..255 }
  304.     END;
  305.  
  306.     CMMultichannel6Color = RECORD
  307.         components:                ARRAY [0..5] OF SInt8; (* unsigned char *) { 0..255 }
  308.     END;
  309.  
  310.     CMMultichannel7Color = RECORD
  311.         components:                ARRAY [0..6] OF SInt8; (* unsigned char *) { 0..255 }
  312.     END;
  313.  
  314.     CMMultichannel8Color = RECORD
  315.         components:                ARRAY [0..7] OF SInt8; (* unsigned char *) { 0..255 }
  316.     END;
  317.  
  318.     CMColor = RECORD
  319.         CASE INTEGER OF
  320.         0: (
  321.             rgb:                        CMRGBColor;
  322.            );
  323.         1: (
  324.             hsv:                        CMHSVColor;
  325.            );
  326.         2: (
  327.             hls:                        CMHLSColor;
  328.            );
  329.         3: (
  330.             XYZ:                        CMXYZColor;
  331.            );
  332.         4: (
  333.             Lab:                        CMLabColor;
  334.            );
  335.         5: (
  336.             Luv:                        CMLuvColor;
  337.            );
  338.         6: (
  339.             Yxy:                        CMYxyColor;
  340.            );
  341.         7: (
  342.             cmyk:                        CMCMYKColor;
  343.            );
  344.         8: (
  345.             cmy:                        CMCMYColor;
  346.            );
  347.         9: (
  348.             gray:                        CMGrayColor;
  349.            );
  350.         10: (
  351.             mc5:                        CMMultichannel5Color;
  352.            );
  353.         11: (
  354.             mc6:                        CMMultichannel6Color;
  355.            );
  356.         12: (
  357.             mc7:                        CMMultichannel7Color;
  358.            );
  359.         13: (
  360.             mc8:                        CMMultichannel8Color;
  361.            );
  362.     END;
  363.  
  364.     CMProfileSearchRecord = RECORD
  365.         header:                    CMHeader;
  366.         fieldMask:                LONGINT;
  367.         reserved:                ARRAY [0..1] OF LONGINT;
  368.     END;
  369.  
  370.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  371.     CMProfileSearchRecordHandle = ^CMProfileSearchRecordPtr;
  372.  
  373. { Search definition for 2.0 }
  374.     CMSearchRecord = RECORD
  375.         CMMType:                OSType;
  376.         profileClass:            OSType;
  377.         dataColorSpace:            OSType;
  378.         profileConnectionSpace:    OSType;
  379.         deviceManufacturer:        LONGINT;
  380.         deviceModel:            LONGINT;
  381.         deviceAttributes:        ARRAY [0..1] OF LONGINT;
  382.         profileFlags:            LONGINT;
  383.         searchMask:                LONGINT;
  384.         filter:                    CMProfileFilterUPP;
  385.     END;
  386.  
  387. { GetCWInfo structures }
  388.     CMMInfoRecord = RECORD
  389.         CMMType:                OSType;
  390.         CMMVersion:                LONGINT;
  391.     END;
  392.  
  393.     CMCWInfoRecord = RECORD
  394.         cmmCount:                LONGINT;
  395.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  396.     END;
  397.  
  398.  
  399. CONST
  400.     cmNoColorPacking            = $0000;
  401.     cmAlphaSpace                = $0080;
  402.     cmWord5ColorPacking            = $0500;
  403.     cmLong8ColorPacking            = $0800;
  404.     cmLong10ColorPacking        = $0a00;
  405.     cmAlphaFirstPacking            = $1000;
  406.     cmOneBitDirectPacking        = $0b00;
  407.  
  408.     cmNoSpace                    = 0;
  409.     cmRGBSpace                    = 1;
  410.     cmCMYKSpace                    = 2;
  411.     cmHSVSpace                    = 3;
  412.     cmHLSSpace                    = 4;
  413.     cmYXYSpace                    = 5;
  414.     cmXYZSpace                    = 6;
  415.     cmLUVSpace                    = 7;
  416.     cmLABSpace                    = 8;
  417.     cmReservedSpace1            = 9;
  418.     cmGraySpace                    = 10;
  419.     cmReservedSpace2            = 11;
  420.     cmGamutResultSpace            = 12;
  421.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace;
  422.     cmGrayASpace                = cmGraySpace + cmAlphaSpace;
  423.     cmRGB16Space                = cmWord5ColorPacking + cmRGBSpace;
  424.     cmRGB32Space                = cmLong8ColorPacking + cmRGBSpace;
  425.     cmARGB32Space                = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace;
  426.     cmCMYK32Space                = cmLong8ColorPacking + cmCMYKSpace;
  427.     cmHSV32Space                = cmLong10ColorPacking + cmHSVSpace;
  428.     cmHLS32Space                = cmLong10ColorPacking + cmHLSSpace;
  429.     cmYXY32Space                = cmLong10ColorPacking + cmYXYSpace;
  430.     cmXYZ32Space                = cmLong10ColorPacking + cmXYZSpace;
  431.     cmLUV32Space                = cmLong10ColorPacking + cmLUVSpace;
  432.     cmLAB32Space                = cmLong10ColorPacking + cmLABSpace;
  433.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace;
  434.  
  435.     
  436. TYPE
  437.     CMBitmapColorSpace = LONGINT;
  438.  
  439.     CMBitmap = RECORD
  440.         image:                    ^CHAR;
  441.         width:                    LONGINT;
  442.         height:                    LONGINT;
  443.         rowBytes:                LONGINT;
  444.         pixelSize:                LONGINT;
  445.         space:                    CMBitmapColorSpace;
  446.         user1:                    LONGINT;
  447.         user2:                    LONGINT;
  448.     END;
  449.  
  450. { Classic Print Manager Stuff }
  451.  
  452. CONST
  453.     enableColorMatchingOp        = 12;
  454.     registerProfileOp            = 13;
  455.  
  456. { PrGeneral parameter blocks }
  457.  
  458. TYPE
  459.     TEnableColorMatchingBlk = RECORD
  460.         iOpCode:                INTEGER;
  461.         iError:                    INTEGER;
  462.         lReserved:                LONGINT;
  463.         hPrint:                    THPrint;
  464.         fEnableIt:                BOOLEAN;
  465.     END;
  466.  
  467.     TRegisterProfileBlk = RECORD
  468.         iOpCode:                INTEGER;
  469.         iError:                    INTEGER;
  470.         lReserved:                LONGINT;
  471.         hPrint:                    THPrint;
  472.         fRegisterIt:            BOOLEAN;
  473.     END;
  474.  
  475.  
  476. CONST
  477.     cmNoProfileBase                = 0;
  478.     cmFileBasedProfile            = 1;
  479.     cmHandleBasedProfile        = 2;
  480.     cmPtrBasedProfile            = 3;
  481.  
  482.  
  483. TYPE
  484.     CMFileLocation = RECORD
  485.         spec:                    FSSpec;
  486.     END;
  487.  
  488.     CMHandleLocation = RECORD
  489.         h:                        Handle;
  490.     END;
  491.  
  492.     CMPtrLocation = RECORD
  493.         p:                        Ptr;
  494.     END;
  495.  
  496.     CMProfLoc = RECORD
  497.         CASE INTEGER OF
  498.         0: (
  499.             fileLoc:                    CMFileLocation;
  500.            );
  501.         1: (
  502.             handleLoc:                    CMHandleLocation;
  503.            );
  504.         2: (
  505.             ptrLoc:                        CMPtrLocation;
  506.            );
  507.     END;
  508.  
  509.     CMProfileLocation = RECORD
  510.         locType:                INTEGER;
  511.         u:                        CMProfLoc;
  512.     END;
  513.  
  514. { Profile file and element access }
  515.  
  516. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  517.     {$IFC NOT GENERATINGCFM}
  518.     INLINE $203C, $0008, $001C, $ABEE;
  519.     {$ENDC}
  520. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  521.     {$IFC NOT GENERATINGCFM}
  522.     INLINE $203C, $0004, $001D, $ABEE;
  523.     {$ENDC}
  524. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  525.     {$IFC NOT GENERATINGCFM}
  526.     INLINE $203C, $0004, $0034, $ABEE;
  527.     {$ENDC}
  528. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  529.     {$IFC NOT GENERATINGCFM}
  530.     INLINE $203C, $0008, $001B, $ABEE;
  531.     {$ENDC}
  532. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  533.     {$IFC NOT GENERATINGCFM}
  534.     INLINE $203C, $000C, $0025, $0ABEE;
  535.     {$ENDC}
  536. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  537.     {$IFC NOT GENERATINGCFM}
  538.     INLINE $203C, $0008, $003C, $0ABEE;
  539.     {$ENDC}
  540. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  541.     {$IFC NOT GENERATINGCFM}
  542.     INLINE $203C, $000C, $0026, $0ABEE;
  543.     {$ENDC}
  544. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  545.     {$IFC NOT GENERATINGCFM}
  546.     INLINE $203C, $0014, $0031, $0ABEE;
  547.     {$ENDC}
  548. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  549.     {$IFC NOT GENERATINGCFM}
  550.     INLINE $203C, $0010, $0032, $0ABEE;
  551.     {$ENDC}
  552. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  553.     {$IFC NOT GENERATINGCFM}
  554.     INLINE $203C, $000C, $001E, $0ABEE;
  555.     {$ENDC}
  556. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: LONGINT): CMError;
  557.     {$IFC NOT GENERATINGCFM}
  558.     INLINE $203C, $0008, $001F, $0ABEE;
  559.     {$ENDC}
  560. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  561.     {$IFC NOT GENERATINGCFM}
  562.     INLINE $203C, $0010, $0020, $0ABEE;
  563.     {$ENDC}
  564. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  565.     {$IFC NOT GENERATINGCFM}
  566.     INLINE $203C, $0008, $0039, $0ABEE;
  567.     {$ENDC}
  568. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; VAR byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  569.     {$IFC NOT GENERATINGCFM}
  570.     INLINE $203C, $0014, $0036, $0ABEE;
  571.     {$ENDC}
  572. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: LONGINT): CMError;
  573.     {$IFC NOT GENERATINGCFM}
  574.     INLINE $203C, $000C, $0038, $0ABEE;
  575.     {$ENDC}
  576. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  577.     {$IFC NOT GENERATINGCFM}
  578.     INLINE $203C, $0014, $0037, $0ABEE;
  579.     {$ENDC}
  580. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: LONGINT; VAR tag: OSType; VAR elementSize: LONGINT; VAR refs: BOOLEAN): CMError;
  581.     {$IFC NOT GENERATINGCFM}
  582.     INLINE $203C, $0014, $0021, $0ABEE;
  583.     {$ENDC}
  584. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: LONGINT; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  585.     {$IFC NOT GENERATINGCFM}
  586.     INLINE $203C, $0010, $0022, $0ABEE;
  587.     {$ENDC}
  588. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  589.     {$IFC NOT GENERATINGCFM}
  590.     INLINE $203C, $0010, $0023, $0ABEE;
  591.     {$ENDC}
  592. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  593.     {$IFC NOT GENERATINGCFM}
  594.     INLINE $203C, $0008, $003A, $0ABEE;
  595.     {$ENDC}
  596. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  597.     {$IFC NOT GENERATINGCFM}
  598.     INLINE $203C, $000C, $0035, $0ABEE;
  599.     {$ENDC}
  600. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  601.     {$IFC NOT GENERATINGCFM}
  602.     INLINE $203C, $0008, $0024, $0ABEE;
  603.     {$ENDC}
  604. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  605.     {$IFC NOT GENERATINGCFM}
  606.     INLINE $203C, $000C, $003E, $0ABEE;
  607.     {$ENDC}
  608. { Low-level matching functions }
  609. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  610.     {$IFC NOT GENERATINGCFM}
  611.     INLINE $203C, $000C, $0014, $0ABEE;
  612.     {$ENDC}
  613. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  614.     {$IFC NOT GENERATINGCFM}
  615.     INLINE $203C, $0008, $0015, $0ABEE;
  616.     {$ENDC}
  617. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  618.     {$IFC NOT GENERATINGCFM}
  619.     INLINE $203C, $000C, $0033, $0ABEE;
  620.     {$ENDC}
  621. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  622.     {$IFC NOT GENERATINGCFM}
  623.     INLINE $203C, $0004, $0001, $0ABEE;
  624.     {$ENDC}
  625. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT): CMError;
  626.     {$IFC NOT GENERATINGCFM}
  627.     INLINE $203C, $000C, $0002, $0ABEE;
  628.     {$ENDC}
  629. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT; VAR result: LONGINT): CMError;
  630.     {$IFC NOT GENERATINGCFM}
  631.     INLINE $203C, $0010, $0003, $0ABEE;
  632.     {$ENDC}
  633. { Bitmap matching }
  634. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  635.     {$IFC NOT GENERATINGCFM}
  636.     INLINE $203C, $0010, $002C, $0ABEE;
  637.     {$ENDC}
  638. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  639.     {$IFC NOT GENERATINGCFM}
  640.     INLINE $203C, $0014, $002D, $0ABEE;
  641.     {$ENDC}
  642. { Quickdraw-specific matching }
  643. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  644.     {$IFC NOT GENERATINGCFM}
  645.     INLINE $203C, $0010, $0004, $0ABEE;
  646.     {$ENDC}
  647. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  648.     {$IFC NOT GENERATINGCFM}
  649.     INLINE $203C, $0014, $0007, $0ABEE;
  650.     {$ENDC}
  651. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  652.     {$IFC NOT GENERATINGCFM}
  653.     INLINE $203C, $000C, $0016, $0ABEE;
  654.     {$ENDC}
  655. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  656.     {$IFC NOT GENERATINGCFM}
  657.     INLINE $203C, $0004, $000B, $0ABEE;
  658.     {$ENDC}
  659. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  660.     {$IFC NOT GENERATINGCFM}
  661.     INLINE $203C, $000C, $0017, $0ABEE;
  662.     {$ENDC}
  663. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  664.     {$IFC NOT GENERATINGCFM}
  665.     INLINE $203C, $0002, $000D, $0ABEE;
  666.     {$ENDC}
  667. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: LONGINT): CMError;
  668.     {$IFC NOT GENERATINGCFM}
  669.     INLINE $203C, $0008, $003B, $0ABEE;
  670.     {$ENDC}
  671. { System Profile access }
  672. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  673.     {$IFC NOT GENERATINGCFM}
  674.     INLINE $203C, $0004, $0018, $0ABEE;
  675.     {$ENDC}
  676. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  677.     {$IFC NOT GENERATINGCFM}
  678.     INLINE $203C, $0004, $0019, $0ABEE;
  679.     {$ENDC}
  680. { External Profile Management }
  681. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  682.     {$IFC NOT GENERATINGCFM}
  683.     INLINE $203C, $0010, $0027, $0ABEE;
  684.     {$ENDC}
  685. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: LONGINT): CMError;
  686.     {$IFC NOT GENERATINGCFM}
  687.     INLINE $203C, $000C, $0028, $0ABEE;
  688.     {$ENDC}
  689. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  690.     {$IFC NOT GENERATINGCFM}
  691.     INLINE $203C, $0004, $0029, $0ABEE;
  692.     {$ENDC}
  693. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: LONGINT; VAR prof: CMProfileRef): CMError;
  694.     {$IFC NOT GENERATINGCFM}
  695.     INLINE $203C, $000C, $002A, $0ABEE;
  696.     {$ENDC}
  697. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: LONGINT; VAR profileFile: FSSpec): CMError;
  698.     {$IFC NOT GENERATINGCFM}
  699.     INLINE $203C, $000C, $002B, $0ABEE;
  700.     {$ENDC}
  701. { Utilities }
  702. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  703.     {$IFC NOT GENERATINGCFM}
  704.     INLINE $203C, $000C, $0011, $0ABEE;
  705.     {$ENDC}
  706. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  707.     {$IFC NOT GENERATINGCFM}
  708.     INLINE $203C, $000C, $001A, $0ABEE;
  709.     {$ENDC}
  710. { PS-related }
  711. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  712.     {$IFC NOT GENERATINGCFM}
  713.     INLINE $203C, $0014, $002E, $0ABEE;
  714.     {$ENDC}
  715. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  716.     {$IFC NOT GENERATINGCFM}
  717.     INLINE $203C, $0014, $002F, $0ABEE;
  718.     {$ENDC}
  719. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  720.     {$IFC NOT GENERATINGCFM}
  721.     INLINE $203C, $0018, $0030, $0ABEE;
  722.     {$ENDC}
  723. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: LONGINT; VAR preferredCMMnotfound: BOOLEAN): CMError;
  724.     {$IFC NOT GENERATINGCFM}
  725.     INLINE $203C, $0010, $003D, $0ABEE;
  726.     {$ENDC}
  727. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  728. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  729.     {$IFC NOT GENERATINGCFM}
  730.     INLINE $203C, $000C, $0000, $0ABEE;
  731.     {$ENDC}
  732. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  733.     {$IFC NOT GENERATINGCFM}
  734.     INLINE $203C, $000C, $000C, $0ABEE;
  735.     {$ENDC}
  736. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  737.     {$IFC NOT GENERATINGCFM}
  738.     INLINE $203C, $000C, $000A, $0ABEE;
  739.     {$ENDC}
  740. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  741.     {$IFC NOT GENERATINGCFM}
  742.     INLINE $203C, $000C, $0009, $0ABEE;
  743.     {$ENDC}
  744. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  745.     {$IFC NOT GENERATINGCFM}
  746.     INLINE $203C, $0004, $0008, $0ABEE;
  747.     {$ENDC}
  748. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  749.     {$IFC NOT GENERATINGCFM}
  750.     INLINE $203C, $0008, $000E, $0ABEE;
  751.     {$ENDC}
  752. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  753.     {$IFC NOT GENERATINGCFM}
  754.     INLINE $203C, $0004, $000F, $0ABEE;
  755.     {$ENDC}
  756. { ProfileResponder functions }
  757. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  758.     {$IFC NOT GENERATINGCFM}
  759.     INLINE $203C, $0010, $0005, $0ABEE;
  760.     {$ENDC}
  761. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  762.     {$IFC NOT GENERATINGCFM}
  763.     INLINE $203C, $000C, $0006, $0ABEE;
  764.     {$ENDC}
  765. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  766.     {$IFC NOT GENERATINGCFM}
  767.     INLINE $203C, $0010, $0010, $0ABEE;
  768.     {$ENDC}
  769. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  770.     {$IFC NOT GENERATINGCFM}
  771.     INLINE $203C, $0014, $0012, $0ABEE;
  772.     {$ENDC}
  773. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  774.     {$IFC NOT GENERATINGCFM}
  775.     INLINE $203C, $000C, $0013, $0ABEE;
  776.     {$ENDC}
  777. {$IFC OLDROUTINENAMES }
  778.  
  779. CONST
  780.     kMatchCMMType                = cmMatchCMMType;
  781.     kMatchApplProfileVersion    = cmMatchApplProfileVersion;
  782.     kMatchDataType                = cmMatchDataType;
  783.     kMatchDeviceType            = cmMatchDeviceType;
  784.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer;
  785.     kMatchDeviceModel            = cmMatchDeviceModel;
  786.     kMatchDeviceAttributes        = cmMatchDeviceAttributes;
  787.     kMatchFlags                    = cmMatchFlags;
  788.     kMatchOptions                = cmMatchOptions;
  789.     kMatchWhite                    = cmMatchWhite;
  790.     kMatchBlack                    = cmMatchBlack;
  791.  
  792. { types }
  793.     
  794. TYPE
  795.     CMYKColor = CMCMYKColor;
  796.  
  797.     CWorld = CMWorldRef;
  798.  
  799.     CMGamutResult = ^LONGINT;
  800.  
  801. { functions }
  802.  
  803. PROCEDURE EndMatching(myRef: CMMatchRef);
  804.     {$IFC NOT GENERATINGCFM}
  805.     INLINE $203C, $0004, $000B, $0ABEE;
  806.     {$ENDC}
  807. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  808.     {$IFC NOT GENERATINGCFM}
  809.     INLINE $203C, $0002, $000D, $0ABEE;
  810.     {$ENDC}
  811. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  812.     {$IFC NOT GENERATINGCFM}
  813.     INLINE $203C, $000C, $0011, $0ABEE;
  814.     {$ENDC}
  815. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  816.     {$IFC NOT GENERATINGCFM}
  817.     INLINE $203C, $000C, $000A, $0ABEE;
  818.     {$ENDC}
  819. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  820.     {$IFC NOT GENERATINGCFM}
  821.     INLINE $203C, $000C, $0009, $0ABEE;
  822.     {$ENDC}
  823. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  824.     {$IFC NOT GENERATINGCFM}
  825.     INLINE $203C, $0004, $0008, $0ABEE;
  826.     {$ENDC}
  827. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  828.     {$IFC NOT GENERATINGCFM}
  829.     INLINE $203C, $0008, $000E, $0ABEE;
  830.     {$ENDC}
  831. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  832.     {$IFC NOT GENERATINGCFM}
  833.     INLINE $203C, $0004, $000F, $0ABEE;
  834.     {$ENDC}
  835. {$ENDC}
  836.  
  837. {$ALIGN RESET}
  838. {$POP}
  839.  
  840. {$SETC UsingIncludes := CMApplicationIncludes}
  841.  
  842. {$ENDC} {__CMAPPLICATION__}
  843.  
  844. {$IFC NOT UsingIncludes}
  845.  END.
  846. {$ENDC}
  847.